<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDistributorBanksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('distributor_banks', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('distributor_id')->index()->default(1)->comment('分销员ID');
            $table->string('name', 190)->nullable()->comment('真实姓名');
            $table->string('id_card_no',190)->index()->nullable()->comment('身份证号');
            $table->string('id_card_start_date',50)->nullable()->comment('身份证生效日期(格式：2019-01-01)');
            $table->string('id_card_expire_date',50)->nullable()->comment('身份证失效日期 永久有效填2999-12-31（格式：2019-12-31）');
            $table->string('mobile',50)->nullable()->comment('手机号码');
            $table->string('email',50)->nullable()->comment('邮箱地址');
            $table->text('id_card_just_url')->nullable()->comment('身份证正面');
            $table->text('id_card_back_url')->nullable()->comment('身份证反面');
            $table->text('bank_card_just_url')->nullable()->comment('银行卡正面');
            $table->string('bank',50)->nullable()->comment('银行名称');
            $table->string('bank_code',50)->nullable()->comment('银行代码号');
            $table->string('bank_name',50)->nullable()->comment('开户行');
            $table->string('bank_no',50)->nullable()->comment('开户行代码号');
            $table->integer('status')->index()->default(1)->comment('状态:1.待开户 2.已开户');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('distributor_banks');
    }
}
